<?php
/**
 * Introduction: 微信token表  weixin_token
 */

namespace Common\Model;


use Think\Model;

class WeixinTokenModel extends Model
{
    //定义数据库连接信息
    protected $connection;

    //定义表名
    protected $tableName = 'weixin_token';

    /**
     * 初始化
     */
    public function _initialize()
    {

        $this->connection = C('Databaese');

    }

    /**
     * 获取一条数据
     */
    public function getOne($name,$account){
        $fields = ['id', 'value', 'create_time'];
        return $this->where("name='$name' and account='$account'")->field($fields)->find();
    }
}